package com.butang.Dao;

import com.butang.project.Emp;
import com.butang.project.XmlParserUtils;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * ClassName: Dao
 * Package: com.butang.project
 * Description:
 *
 * @Author BuTang
 * @Create 2023/7/3 11:30
 * @Version 1.0
 */

@Component
public class Dao implements Emplent {
    @Override
    public List<Emp> listEmp() {
        String file = this.getClass().getClassLoader().getResource("emp.xml").getFile();
        // System.out.println(file);


        List<Emp> list = XmlParserUtils.parse(file, Emp.class);
        return list;
    }


}
